﻿@model PagedList.IPagedList<QAS.Nekorama.Question>
@using PagedList.Mvc;
<link href="~/Content/PagedList.css" rel="stylesheet" type="text/css" />
<link href="~/Content/QInQList.css" rel="stylesheet" />
@{
    ViewBag.Title = "Home Page";
}

<div class ="float-right">
                    <ul class="sortQ">
                        <li class="sortQ">@Html.ActionLink("Newest", "Index", new { sortOrder = ViewBag.NewestSortParm })</li>
                        <li class="sortQ">@Html.ActionLink("Frequent", "Index", new { sortOrder = ViewBag.FrequentSortParm })</li>
                        <li class="sortQ">@Html.ActionLink("Votes", "Index", new { sortOrder = ViewBag.VotesSortParm })</li>
                        <li class="sortQ">@Html.ActionLink("Featured", "Index", new { sortOrder = ViewBag.FeaturedSortParm })</li>
                        <li class="sortQ">@Html.ActionLink("Unanswered", "Index", new { sortOrder = ViewBag.UnansweredSortParm })</li>
                    </ul>
                </div>
@foreach (var item in Model)
{
    <div>
        <h3> @Html.DisplayFor(modelItem => item.Title)</h3>
        @Html.DisplayFor(modelItem => item.Content)<br/>
        Votes: @Html.DisplayFor(modelItem => item.VoteCount)<br/>
        Views: @Html.DisplayFor(modelItem => item.ViewCount)<br/>
        Spam: @Html.DisplayFor(modelItem => item.IsSpam)<br/>
        <a>@Html.DisplayFor(modelItem => item.Tag.TagName)</a>    
        <a> @Html.DisplayFor(modelItem => item.Tag1.TagName)</a>
        <a>@Html.DisplayFor(modelItem => item.Tag2.TagName)</a>
        <a> @Html.DisplayFor(modelItem => item.Tag3.TagName)</a>
        <a>@Html.DisplayFor(modelItem => item.Tag4.TagName)</a><br/>
        Edit reason:  @Html.DisplayFor(modelItem => item.EditReason)<br/>
        Created date: @Html.DisplayFor(modelItem => item.CreatedDate) @Html.DisplayFor(modelItem => item.User.DisplayName)<br/>
        Modified date:  @Html.DisplayFor(modelItem => item.LastModifiedDate)  @Html.DisplayFor(modelItem => item.User1.DisplayName)
    </div>
}
<br />
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount

@Html.PagedListPager(Model, page => Url.Action("Index", 
    new { page, sortOrder = ViewBag.CurrentSort}))
